import { ajax } from '../http.js';
import { ajaxSync } from '../httpSync.js';

const teamNumUrl = '/authc/user_rank/find_team_and_V0Num'; // 当前登录人信息
const amountByInviteUrl = '/authc/user_rank/find_amount_by_invite_id'; // 查询推荐人数比例
const rankByInviteUrl = '/authc/user_rank/find_user_rank_by_invite_id'; // 客户列表
const teamByRankUrl = '/authc/business/analyze/team_by_rank'; // 团队各等级人数及比例
const userRankUrl = '/authc/user_rank/find_user_rank'; // 获取等级

// const amountByInvite = (data, success, fail) => // 查询推荐人数比例
//   ajax({
//     url: amountByInviteUrl,
//     data: data,
//     success: success,
//     fail: fail
//   });

const teamNum = (data, success, fail) => {
  return ajaxSync({
    url: teamNumUrl,
    data: data,
    success: success,
    fail: fail
  });
};
// const teamNum = (data, success, fail) => // 当前登录人信息
//   ajax({
//     url: teamNumUrl,
//     data: data,
//     success: success,
//     fail: fail
//   });
const teamByRank = (data, success, fail) => {
  return ajaxSync({
    url: teamByRankUrl,
    data: data,
    success: success,
    fail: fail
  });
};

const rankByInvite = (data, success, fail) => // 查询推荐人数比例
  ajax({
    url: rankByInviteUrl,
    data: data,
    success: success,
    fail: fail
  });

const amountByInvite = (data, success, fail) => {
  return ajaxSync({
    url: amountByInviteUrl,
    data: data,
    success: success,
    fail: fail
  });
};

const userRank = (data, success, fail) => // 查询等级
  ajax({
    url: userRankUrl,
    data: data,
    success: success,
    fail: fail
  });
export {
  teamNum,
  amountByInvite,
  rankByInvite,
  teamByRank,
	userRank
}